
const HapiSwagger = require('hapi-swagger');

module.exports = {
  name: 'hapiSwaggerPlugin',
  register: async (server) => {
    await server.register(
      {
        plugin: HapiSwagger,
        options: {
          info: {
            title: '问卷系统接口文档',
          },
          auth: false,
          grouping: 'tags',
          tags: [
            { name: 'users', description: '用户管理' },
            { name: 'policies', description: '策略管理' },
            { name: 'menus', description: '菜单管理' },
            { name: 'classes', description: '班级管理' },
            { name: 'outlines', description: '大纲管理' },
            { name: 'init', description: '初始化' },
            { name: 'items', description: '选项管理' },
            { name: 'papers', description: '问卷管理' },
            { name: 'answers', description: '答卷管理' },
          ],
        },
      },
    );
  },
};
